import 'package:native_dart_package/http/request/exception/api_exception.dart';
import 'package:yt_devops/configs.dart';
import 'package:yt_devops/services/predicates.dart';

class MessageServices {
  /// 获取公告列表
  Future getAnnouncementList(params, {bool Function(ApiException)? onError}) {
    return Configs.httpClient.get(
      '$system/notice/list',
      queryParameters: params,
      onError: onError,
    );
  }

  /// 获取公告详情
  Future getAnnouncementDetail(params, {bool Function(ApiException)? onError}) {
    return Configs.httpClient.get(
      '$system/notice/detail',
      queryParameters: params,
      onError: onError,
    );
  }

  /// 全部已读接口
  Future updateAnnouncementStatus(params,
      {bool Function(ApiException)? onError}) {
    return Configs.httpClient.put(
      '$system/notice/updateStatus',
      queryParameters: params,
      onError: onError,
    );
  }
}
